<%@include file="/WEB-INF/pages/commons/commons.jsp"%>

<fmt:message var="title" key="blogs.jsp.title" scope="request"/>
<stripes:layout-render name="${_themePath}/basic-layout-without-navbar.jsp" _title="${title}">
    <stripes:layout-component name="_content">

        <stripes:layout-component name="_topNav">
            <H1>Blogs Profile</H1>
            <UL class="gc-topnav-tabs">
                <LI>&nbsp;</LI>
            </UL>
        </stripes:layout-component>


        <h2>Details</h2>
        <jsecurity:hasPermission name="user:addBlog:*">
        <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="newBlog">
            <fmt:message key="blogs.jsp.newBlog"/>
        </stripes:link>
        <br/>
        </jsecurity:hasPermission>

        <!-- eg. administrator -->
        <jsecurity:hasPermission name="blog:viewBlogs:*">
            <h3><fmt:message key="blogs.jsp.allblog.table.title"/></h3>
            <fmt:message var="col_blogId" key="blogs.jsp.col.blog_id" scope="request"/>
            <fmt:message var="col_blogName" key="blogs.jsp.col.blog_name" scope="request"/>
            <fmt:message var="col_blogDescription" key="blogs.jsp.col.blog_description" scope="request"/>
            <fmt:message var="col_blogActions" key="blogs.jsp.col.blogActions" scope="request"/>
            <fmt:message var="col_entryActions" key="blogs.jsp.col.entryActions" scope="request"/>
            <fmt:message var="col_tagActions" key="blogs.jsp.col.tagActions" scope="request"/>
            <fmt:message var="col_linkActions" key="blogs.jsp.col.linkActions" scope="request"/>
            <fmt:message var="col_resourceActions" key="blogs.jsp.col.resourceActions" scope="request"/>
            <stripes:url var="allBlogsUri" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" prependContext="false">
                <stripes:param name="currentPaginatedListName" value="allBlogsPaginatedList"/>
            </stripes:url>
            <displaytag:table id="element" name="actionBean.allBlogs.list" sort="external"
                                      excludedParams="*"
                                      defaultsort="1"
                                      defaultorder="ascending"
                                      partialList="true"
                                      size="actionBean.allBlogs.fullListSize"
                                      requestURI="${allBlogsUri}"
                                      requestURIcontext="true" style="width:100%;">
                        <displaytag_el:column property="id" sortable="false" sortName="id" title="${col_blogId}"  />
                        <displaytag_el:column property="name" sortable="false" sortName="name" title="${col_blogName}" />
                        <displaytag_el:column title="${col_blogActions}">
                            <jsecurity:hasPermission name="blog:viewBlogs:${element.id}">
                            <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="viewBlog">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.viewBlog"/>
                            </stripes:link>
                            </jsecurity:hasPermission>
                            <jsecurity:hasPermission name="blog:editBlog:${element.id}">
                            |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="editBlog">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.editBlog"/>
                            </stripes:link>
                            </jsecurity:hasPermission>
                            <jsecurity:hasPermission name="blog:deleteBlog:${element.id}">
                            |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="deleteBlog">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.removeBlog"/>
                            </stripes:link>
                            </jsecurity:hasPermission>
                            <jsecurity:hasPermission name="blog:addBlogMembership:${element.id}">
                            |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="membership">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.membership" />
                            </stripes:link>
                            </jsecurity:hasPermission>
                            <jsecurity:hasPermission name="blog:viewBlogMainPage:${element.id}">
                            |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.general.BlogActionBean" event="view">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.blogPage" />
                            </stripes:link>
                            </jsecurity:hasPermission>
                        </displaytag_el:column>
                        <displaytag_el:column title="${col_entryActions}">
                            <jsecurity:hasPermission name="blog:viewBlogEntries:${element.id}">
                            <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="viewBlogEntries">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.viewBlogEntries"/>
                            </stripes:link>
                            </jsecurity:hasPermission>
                            |&nbsp;<jsecurity:hasPermission name="blog:newBlogEntry:${element.id}">
                            <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="newBlogEntry">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.newBlogEntry"/>
                            </stripes:link>
                            </jsecurity:hasPermission>
                        </displaytag_el:column>
                        <displaytag_el:column title="${col_tagActions}">
                            <jsecurity:hasPermission name="blog:viewTags:${element.id}">
                            <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="tags">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.viewTags"/>
                            </stripes:link>
                            </jsecurity:hasPermission>
                        </displaytag_el:column>
                        <displaytag_el:column title="${col_linkActions}">
                            <jsecurity:hasPermission name="blog:viewLinks:${element.id}">
                            <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="links">
                                <stripes:param name="blog" value="${element.id}"/>
                                <fmt:message key="blogs.jsp.action.viewLinks" />
                            </stripes:link>
                            </jsecurity:hasPermission>
                        </displaytag_el:column>
                    </displaytag:table>
        </jsecurity:hasPermission>


        <!-- eg. non-administrator -->
        <jsecurity:lacksPermission name="blog:viewBlogs:*">
        <!-- blogs ownership table -->
        <h3><fmt:message key="blogs.jsp.ownershipblog.table.title"/></h3>
        <fmt:message var="col_blogId" key="blogs.jsp.col.blog_id" scope="request"/>
        <fmt:message var="col_blogName" key="blogs.jsp.col.blog_name" scope="request"/>
        <fmt:message var="col_blogDescription" key="blogs.jsp.col.blog_description" scope="request"/>
        <fmt:message var="col_blogActions" key="blogs.jsp.col.blogActions" scope="request"/>
        <fmt:message var="col_entryActions" key="blogs.jsp.col.entryActions" scope="request"/>
        <fmt:message var="col_tagActions" key="blogs.jsp.col.tagActions" scope="request"/>
        <fmt:message var="col_linkActions" key="blogs.jsp.col.linkActions" scope="request"/>
        <fmt:message var="col_resourceActions" key="blogs.jsp.col.resourceActions" scope="request"/>
        <stripes:url var="ownershipBlogsUri" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" prependContext="false">
            <stripes:param name="currentPaginatedListName" value="ownershipBlogsPaginatedList"/>
        </stripes:url>
        <displaytag:table id="element" name="actionBean.ownershipBlogs.list" sort="external"
                          excludedParams="*"
                          defaultsort="1"
                          defaultorder="ascending"
                          style="width:100%;"  
                          requestURI="${ownershipBlogsUri}"
                          requestURIcontext="true" >
            <displaytag_el:column property="id" sortable="false" sortName="id" title="${col_blogId}"  />
            <displaytag_el:column property="name" sortable="false" sortName="name" title="${col_blogName}" />
            <displaytag_el:column title="${col_blogActions}">
                <jsecurity:hasPermission name="blog:viewBlog:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="viewBlog">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewBlog"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:editBlog:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="editBlog">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.editBlog"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:deleteBlog:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="deleteBlog">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.removeBlog"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:addBlogMembership:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="membership">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.membership" />
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:viewBlogMainPage:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.general.BlogActionBean" event="view">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.blogPage" />
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_entryActions}">
                <jsecurity:hasPermission name="blog:viewBlogEntries:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="viewBlogEntries">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewBlogEntries"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:newBlogEntry:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="newBlogEntry">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.newBlogEntry"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_tagActions}">
                <jsecurity:hasPermission name="blog:viewTags:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="tags">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewTags"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_linkActions}">
                <jsecurity:hasPermission name="blog:viewLinks:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="links">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewLinks" />
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_resourceActions}">
                <jsecurity:hasPermission name="blog:viewResources:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="resources">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewResources"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
        </displaytag:table>



        <!-- blogs membership table -->
        <h3><fmt:message key="blogs.jsp.membershipblog.table.title"/></h3>
        <stripes:url var="membershipBlogUri" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" prependContext="false">
            <stripes:param name="currentPaginatedListName" value="membershipBlogsPaginatedList"/>
        </stripes:url>
        <displaytag:table id="element" name="actionBean.membershipBlogs.list" sort="external"
                          excludedParams="*"
                          defaultsort="1"
                          defaultorder="ascending"
                          style="width:100%;"
                          requestURI="${membershipBlogsUri}"
                          requestURIcontext="true" >
            <displaytag_el:column property="id" sortable="false" sortName="id" title="${col_blogId}"  />
            <displaytag_el:column property="name" sortable="false" sortName="name" title="${col_blogName}" />
            <displaytag_el:column title="${col_blogActions}">
                <jsecurity:hasPermission name="blog:viewBlogs:${element.id}">
                <stripes:link id="view" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="viewBlog">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewBlog"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:editBlog:${element.id}">
                |&nbsp;<stripes:link id="edit" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="editBlog">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.editBlog"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:deleteBlog:${element.id}">
                |&nbsp;<stripes:link id="remove" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="deleteBlog">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.removeBlog"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:addBlogMembership:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="membership">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.membership" />
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:viewBlogMainPage:${element.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.general.BlogActionBean" event="view">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.blogPage" />
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_entryActions}">
                <jsecurity:hasPermission name="blog:viewBlogEntries:${element.id}">
                <stripes:link id="view" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="viewBlogEntries">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewBlogEntries"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:newBlogEntry:${element.id}">
                |&nbsp;<stripes:link id="view" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="newBlogEntry">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.newBlogEntry"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_tagActions}">
                <jsecurity:hasPermission name="blog:viewTags:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="tags">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewTags"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_linkActions}">
                <jsecurity:hasPermission name="blog:viewLinks:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="links">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewLinks" />
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
            <displaytag_el:column title="${col_resourceActions}">
                <jsecurity:hasPermission name="blog:viewResources:${element.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="resources">
                    <stripes:param name="blog" value="${element.id}"/>
                    <fmt:message key="blogs.jsp.action.viewResources"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
        </displaytag:table>
        </jsecurity:lacksPermission>

</stripes:layout-component>
</stripes:layout-render>

